<!DOCTYPE html>
<!-- HTML5 Boilerplate -->
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="zh-CN"> <![endif]-->
<!--[if (IE 7)&!(IEMobile)]>
<html class="no-js lt-ie9 lt-ie8" lang="zh-CN"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]>
<html class="no-js lt-ie9" lang="zh-CN"><![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="zh-CN">
<!--<![endif]-->

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>众源效果</title>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link href="css/reset.css" rel="stylesheet" />
    <link href="css/bootstrap.css" rel="stylesheet" />
    <link href="css/nf.min.css" rel="stylesheet" />
    <link href="css/swiper.min.css" rel="stylesheet" />
    <link href="css/css.css" rel="stylesheet" />
    <link href="css/zy.css" rel="stylesheet">
    <link rel="stylesheet" href="css/jquery.page.css">
    <style>
    .first, .last{ width:auto}
    p{
    overflow : hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    }
    </style>
    <script src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/layer/layer.js"></script>
    <script type="text/javascript" src="js/jquery.page.js"></script>
    <script type="text/javascript" src="js/uaredirect.js"></script>
    <script type="text/javascript" >uaredirect("http://106.14.39.133:8081/wap_zy.html");</script>
    

</head>

<body>
    <!-- ========================= 通用导航 ======================== -->


    <hgroup class="navbar ">
        <div class="navbar-header container">
            <div class="navbar-brand">
                <a href="#" class="logo">
                    <!-- <img  src="images/logo.png"  alt="易点科技" draggable="false" class="img-sy"> --></a>
            </div>
            <div class="nav-right menu_nav">
                <ul>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
            <nav class="nav-right nav-top-l">
                <ul class="navbar-nav nav1 row">
                    <li>
                        <a href="index.html">众源</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li class="cur">
                        <a href="ziyuan.html">资源搜索</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li>
                        <a href="jiaocheng.html">使用教程</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li>
                        <a href="biaozhun.html">行业API</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li>
                        <a href="page.html">关于我们</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li id="userbox">
                        <a href="login.html">登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                        <a href="register.html">注册</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li>
                        <a href="">中文</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                        <a href="">English</a>
                        <sub class="sub1"></sub>
                    </li>
                    <li>
                        
                        <sub class="sub1"></sub>
                    </li>
                </ul>
            </nav>
        </div>
    </hgroup>
    <!-- //////////////////////// 通用导航 结束 //////////////////////// -->
    <!-- ========================= 通用banner图 ======================== -->
    <div class="header1" style="height:400px;">
        <div class="flexslider" data-namespace="home-banner-" data-animation="slide" data-speed="5000" data-controls-container=".home-banner-controllers" data-control-nav=true data-direction-nav=false data-autoplay=true data-hover-pause=true>
            <ul class="slides clearfix">
                <li class="align-vertical" style="background:url(images/search.jpg) no-repeat center center;background-size:cover">
                    <div class="vertical-inner">
                        <div class="container">
                            <!--  <p class="txt-tit"></p>-->
                            <div class="bBox" style="width: 880px;">
                                <span>资源搜索</span>
                            </div>
                        </div>
                    </div>
                </li>

            </ul>
        </div>

    </div>
    <!-- //////////////////////// 通用banner图 结束 //////////////////////// -->
    <article>    
        <section class="partner_sec" style="padding-top: 28px;">
            <div class="container">
<!--  
    内容
-->
                <div class="bb">
                    <form action="" method="" class="form1 l">
                        <input type="text" id="keyWord" onKeyDown="keySearch()" placeholder="输入关键词，开启你的大数据互联时代！" class="soso">
                        <button type="button" class="button" id="btnSearch">搜索</button>
                    </form>
                    <a href="/agent.html" class="shouchang r form1" id="mycollectnums" target="_blank">我的收藏（<span id="collectNums">请先登入</span> ）</a>
                    <a class="p4">（筛选搜索结果）</a>
                    <ul class="dq_info" style="margin-top: 5px;">
                        <li style="height: 28px;" id="areaBox">
                            <b class="l">地区：</b>
                            <a href="javascript:;" class="active" data-init="all" data-type="region">全部</a>
                            <a href="javascript:;" data-type="region" data-name="北京">北京</a>
                            <a href="javascript:;" data-type="region" data-name="北京">上海</a>
                            <a href="javascript:;" data-type="region"  data-name="浙江">浙江</a>       
                            <a href="javascript:showDivFun()"> ... </a>
                        </li>
                        <li  id="domainsBox">
                            <b class="l">领域：</b>
                            <a href="javascript:;"  data-init="all"  class="active" data-type="domains">全部</a>
                            <a href="javascript:;" data-type="domains"  data-name="经济">经济</a>
                            <a href="javascript:;" data-type="domains"  data-name="政府">政府</a>
                            <a href="javascript:;" data-type="domains"  data-name="金融">金融</a>
                            <a href="javascript:showDivFun()">...</a>
                            <script>
                                //弹出调用的方法
                                function showDivFun(){
                                    document.getElementById('popDiv').style.display='block';
                                }
                                //关闭事件
                                function closeDivFun(){
                                    document.getElementById('popDiv').style.display='none';
                                }
                                </script>
                            <!-- 弹出窗口 -->
                            <div id="popDiv" class="mydiv" style="display:none;">
                                <div align="right" style="padding:2px;z-index:2000;font-size:12px;cursor:pointer;position:absolute;right:0;" onclick="closeDivFun()">
                                <span class="mydivspan">×</span>
                                </div>
                                <a href="/ziyuan.html" class="a3">天津</a>
                                <a href="/ziyuan.html" class="a3">湖北</a>
                                <a href="/ziyuan.html" class="a3">深圳</a>
                                <a href="/ziyuan.html" class="a3">广州</a>
                            </div>
                        </li>
                    </ul>

                </div>
                <!-- 开始循环 -->
                
                <div class="agentResult">
                   <div  id="agentResult" style="width:73%; float:left">
                        
                   </div>
                    <div class="soso_right r" id="searchResultParent">
                        <h2>最近搜索记录</h2>
                        <ul class="j_list"  id="searchResult">
                          
                        </ul>
                    </div>
                   
                    
                </div>
                
                <!--/结束循环-->
                
                <!-- 分页 -->
                <div  id="pageNav" data-all="0">
                   
                </div>



            </div>
        </section>

    </article>
    <!--底部-->
    <footer>
        <div class="footer_con">
            <div class="container">
                <div class="container_inner">
                    <div class="footer-left">
                        <div><img src="images/tel.jpg" /></div>
                        <div class="tell_list">
                            <ul>
                                <li>
                                    邮 箱: <font color="#fff">seminfo@aliyun.com</font>
                                    <span style="padding-left: 55px;"></span>
                                    数据使用相关: <font color="#fff">seminfo@aliyun.com</font>
                                </li>
                                <li>
                                    地  址：<font color="#fff">中国上海和美国波士顿</font>
                                    <span style="padding-left: 50px;"></span>
                                    数据源（对接谈判）：<font color="#fff">中国上海和美国波士顿</font>
                                </li>
                                <li>
                                    Tel：<font color="#fff">+86&nbsp;18521701931(中)</font>
                                    <span style="padding-left: 59px;"></span>
                                    众源技术支持： <font color="#fff">+86 18521701931 (中)</font>
                                </li>
                                <li>
                                    Tel：<font color="#fff">+86&nbsp;+1 (212) 222-6688 (U.S.)</font>
                                </li>
                            </ul>
                        </div>
                    </div>

                    <div class="footer-left">
                        <div class="link_tit">更多可以了解的信息</div>
                        <div class="link_list">
                            <ul>
                                <li><a href="">法律公告</a></li>
                                <li><a href="">保护您的隐私</a></li>
                                <li><a href="">加入我们</a></li>
                            </ul>
                        </div>
                        <div class="consult">售前QQ咨询</div>
                        <a href="#" style="margin-right:5px;"><img src="images/qq_consult.png" /></a>
                        <a href="#"><img src="images/qq_consult.png" /></a>
                    </div>
                    <div class="footer-left">
                        <div class="footer_code buzz-out"><img src="images/code_icon.png" /></div>
                        <div class="contact_icon">
                            <ul>
                                <li>
                                    <a href=""></a>
                                </li>
                                <li>
                                    <a href=""></a>
                                </li>
                                <li>
                                    <a href=""></a>
                                </li>
                            </ul>
                        </div>
                    </div>

                </div>
            </div>
        </div>
        <div class="copyright">
            <span style="margin-right:25px;">Copyright @ 2016-2017 语义(上海)信息科技有限公司       </span>
            <span>技术支持：<a href="http://www.xingchaoyes.com/index.php" target="_blank" title="星巢网络,网站建设第一站！">星巢网络</a> </span>
        </div>
    </footer>
    <!--弹窗-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                    <h4 class="modal-title" id="myModalLabel"></h4>
                </div>
                <div class="modal-body">

                    <div class="form-group form-group-img">
                       <img src="images/head_img.jpg" alt="">
                    </div>
                    <div class="form-group">
                        <input type="text" name="txt_username" class="form-control" id="txt_username" placeholder="账号">
                    </div>
                    <div class="form-group">
                        <input type="text" name="txt_password" class="form-control" id="txt_password" placeholder="密码">
                    </div>
                </div>
                <div class="modal-footer">
                   <div class="form-login">LOGIN</div>
                   <div style="text-align:left;line-height:30px;height:30"><a >LOST&nbsp;PASSWORD</a>&nbsp;&nbsp;&nbsp;&nbsp;<a >REGIST</a></div>
                </div>
            </div>
        </div>
    </div>
    <script src="js/jquery.flexslider.min.js"></script>
    <script src="js/swiper.min.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/jquery.touchSwipe.min.js"></script>
    <script src="js/main.js"></script>
    <script src="js/jquery.carouFredSel-6.2.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        $(window).load(function () {
            $('.qode_carousels').find('.slides').carouFredSel({
                circular: true,
                responsive: true,
                scroll: {
                    items: 1,
                    duration: 1000,
                    pauseOnHover: false
                },
                items: {
                    <!-- width: 100, -->
                    visible: {
                        min: 1,
                        max: 9
                    }
                },
                auto: true,
                mousewheel: false,
                swipe: {
                    onMouse: true,
                    onTouch: true
                }
            }).animate({
                'opacity': 1
            }, 1000)

            $('.caroufredsel_wrapper').height($('.qode_carousels ul li.item').outerHeight());
        });

        /*******banner图*******/
        $('.flexslider').flexslider({
            animation: "fade",
            slideshow: true,
            animationSpeed: 1000,
            slideshowSpeed: 5000,
            animationSpeed: 1000, //滚动时间ms
            animationLoop: true,
            touch: true //是否支持触屏滑动
        });
        $('.flex-control-nav li a').html('');
        /*************case_sec**************/
        var mySwiper = new Swiper('.swiper-container', {
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            slidesPerView: 3,
            paginationClickable: true,
        });

        /**********partner_sec*****************/
        $('.flexslider2').flexslider({
            animation: "slide",
            slideshowSpeed: 10000, //展示时间间隔ms
            animationSpeed: 1000, //滚动时间ms
            controlNav: false,
            directionNav: true
        });
   

      
    </script>
    <script src="js/bootstrap.min.js"></script>
    <script>
    //注册新增按钮的事件
    $("#login").click(function () {
        $('#myModal').modal();
    });
    </script>
    
</body>

</html>
 <script type="text/javascript" src="js/App.min.js"></script>
 <script type="text/javascript">
 
 function  getQueryString(name){
	 
	 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
	 var r = window.location.search.substr(1).match(reg);
	 if(r!=null)return  unescape(r[2]); return null;
}
	  
 var areas = getQueryString('areas')==null?'':getQueryString('areas');
 var domains = getQueryString('domains')==null?'':getQueryString('domains');
 var keyWord = getQueryString('keyWord')==null?'':getQueryString('keyWord');
 if(keyWord!=''){
    $('#keyWord').val(keyWord);	 
 }
  if(areas!=''){
    var areas_ar = areas.split(',');
	for(var i in areas_ar){
		$("a[data-name='"+areas_ar[i]+"']").addClass('active')
	}
 }
 if(domains!=''){
    var domains_ar = domains.split(',');
	for(var i in domains_ar){
		//alert(domains_ar[i]);
		$("a[data-name='"+domains_ar[i]+"']").addClass('active')
	}
 }
 
 var searchConfig = {
		domains:domains,
		keyWord:keyWord,
		regions:areas,
		pageSize:10,
		page:1,
	    condition:1
	};
$(function(){
	
	setTimeout(function(){
	  	getList();
	},500);
	
   
   $('#btnSearch').bind('click',function(){
	   
	   var keyWord = $('#keyWord').val();
	   /*if(keyWord ==''){
		  layer.tips('请输入关键词', '#keyWord', {
			  tips: [1, '#f00'] //还可配置颜色
			});
		  return false;
	   }*/
	  searchConfig.keyWord = keyWord;   
	  searchConfig.condition = 1; 
	  searchConfig.page = 1;
	  getList();
   });	
	
	$('#areaBox  a').click(function(){
		var init = $(this).data('init');
		
		if(init == 'all'){
			 $('#areaBox  a').removeClass('active') ;
			 $(this).addClass('active') ;
			 updateConfig();
			 return false; 
		}else{
			$('#areaBox  a').eq(0).removeClass('active') ;
		}
		
		if($(this).data('type')!=undefined){
	      if($(this).hasClass('active')){
			  $(this).removeClass('active')  
		  }else{
			  $(this).addClass('active')  
		  }
		
		   updateConfig();
		 }
	});
	$('#domainsBox  a').click(function(){
		var init = $(this).data('init');
		
		if(init == 'all'){
			 $('#domainsBox  a').removeClass('active') ;
			 $(this).addClass('active') ;
			 updateConfig();
			 return false; 
		}else{
			$('#domainsBox  a').eq(0).removeClass('active') ;
		}
		if($(this).data('type') != undefined){
			  if($(this).hasClass('active')){
				  $(this).removeClass('active')  
			  }else{
				  $(this).addClass('active')  
			  }
			  updateConfig();
		}
	});
	

	
})
function keySearch(){
	 if (event.keyCode==13){ 
	      $('#btnSearch').click();
	 }
}
function updateConfig(){
	
	var regions = '';
	var domains = '';
	$('#areaBox  a.active').each(function(index, element) {
        var v = $(this).html();
		if(v !='全部' && v !='...')
		regions += regions==''?v:','+v;
    });
	searchConfig.regions = regions;
	$('#domainsBox  a.active').each(function(index, element) {
        var v = $(this).html();
		if(v !='全部' && v !='...')
		domains += domains==''?v:','+v;
    });
	searchConfig.domains = domains;
	searchConfig.condition = 1;
	 searchConfig.page = 1;
	//getList();
}
function getList(){
    var url = "http://www.usources.cn/api/agent/search";
	
	var loading = layer.msg('正在获取数据，请等候...', {icon: 16,time: 999999, shade: [0.3, '#000']});
   
	$.ajax({
		  url:url+'?'+Math.random(),
		  type:'GET',
		   xhrFields: {
		   withCredentials: true
		  },
		  crossDomain:true,
		  data:{pageNo:searchConfig.page,pageSize:searchConfig.pageSize,domains:searchConfig.domains,keyWord:searchConfig.keyWord,regions:searchConfig.regions,jsonpCallback:'userCollects'},
		  success:function(data){
			 layer.close(loading);
			 if(data.code==200){
				 var  l = data.data.list.length;
				 if(l==0){
				     //layer.msg('没有找到',{icon:1});
					 $("#agentResult").empty().append('<div class="soso_list"><p style=" text-align:center">未找到搜索结果!</p></div>');
					 $("#pageNav").Page({
						  totalPages:0,//分页总数
						  liNums: 5,//分页的数字按钮数(建议取奇数)
						  activeClass: 'activP', //active 类样式定义
						  callBack : function(page){
								//console.log(page)
								searchConfig.page = page;
								getList();
						  }
					  });
					 return false;	 
				 }
				 var listdata = '';
				 for(var i in data.data.list){
					 var res = data.data.list[i];
					 var ysc = '<a href="javascript:;" style="float:right" onclick="addToCollect('+res.id+',this)">加入收藏</a>';
					 if(res.collected==true) ysc = '<a href="javascript:;">已收藏</a>';
					 listdata += ' <div class="soso_left l"><div class="soso_list"><div class="soso_list_i l"><img src="http://www.usources.cn/'+res.imgUrl+'" /></div><div class="soso_list_c r"><div class="soso_list_ct"><h2><a href="detail.html?id='+res.id+'#iri=http://www.usources.cn/concept/'+res.agentUrl+'" style="font-size:18px; color:#1a0dab" >'+res.title+'</a></h2><span style="float:left; margin-left:10px"><img src="images/stars/'+res.dataStar+'.png" style="height:18px"></span><font color="green"> ✓ 已对接，'+res.createdDate+' 最新更新</font>'+ysc+'</div><div class="clear"></div><div class="soso_list_cc"><p>'+res.briefIntro+'</p></div></div></div></div>';
				 }
				 $("#agentResult").empty().append(listdata);
				 if(searchConfig.condition==1){
					 var rInfo = data.data.info;
					
					  var totalSize =  rInfo.hasOwnProperty('totalSize')?rInfo.totalSize:-1;
					  var totalPages = $("#pageNav").data('all');
					  if(totalSize != -1){
						  totalPages = Math.ceil(totalSize/searchConfig.pageSize);
					  }
					  $("#pageNav").Page({
						  totalPages:totalPages,//分页总数
						  liNums: 5,//分页的数字按钮数(建议取奇数)
						  activeClass: 'activP', //active 类样式定义
						  callBack : function(page){
								//console.log(page)
								searchConfig.page = page;
								getList();
						  }
					});
					searchConfig.condition =0;
				 }
				
				
			 }else{
			
				layer.msg('未知code的错误！',{icon:2});
				 
			 }
		},dataType:'json'}
		
	);	
}

function addToCollect(agentId,obj){
	 
	  var url = "http://www.usources.cn/api/user/collectAgent";
	   var loading = layer.msg('正在加入收藏，请等候...', {icon: 16,time: 999999, shade: [0.3, '#000']});
	   $.ajax({
		  url:url+'?'+Math.random(),
		  type:'GET',
		   xhrFields: {
		   withCredentials: true
		  },
		  crossDomain:true,
		  data:{agentId:agentId,jsonpCallback:'delUserCollect'},
		  success:function(data){
			   layer.close(loading);
			   if(data.code==200){
				   layer.msg('加入成功！',{icon:1});
				   $(obj).html('已收藏');
				   $(obj).removeAttr('onclick');
			   }else{
				  layer.msg('请先登录！',{icon:2});
			      setTimeout(function(){ location.href ='login.html';},2000)
			   }
			  
		  },dataType:'json'});
	
}

function getCollectNums(){
	 
	  var url = "http://www.usources.cn/api/agent/userCollectNum";
	   var loading = layer.msg('正在获取收藏数，请等候...', {icon: 16,time: 999999, shade: [0.3, '#000']});
	   $.ajax({
		  url:url+'?'+Math.random(),
		  type:'GET',
		   xhrFields: {
		   withCredentials: true
		  },
		  crossDomain:true,
		  data:{jsonpCallback:'userCollectNum'},
		  success:function(data){
			   layer.close(loading);
			   if(data.code==200){
				  $('#collectNums').html(data.data.info.num);
			   }else{
				  $('#mycollectnums').remove();   
			   }
		  },dataType:'json'});
	
}
 getCollectNums();

function getSearch(){
	
	 var url = "http://www.usources.cn/api/user/searchHistory";
	   var loading = layer.msg('正在获取搜索记录，请等候...', {icon: 16,time: 999999, shade: [0.3, '#000']});
	   $.ajax({
		  url:url+'?'+Math.random(),
		  type:'GET',
		   xhrFields: {
		   withCredentials: true
		  },
		  crossDomain:true,
		  data:{jsonpCallback:'searchHistory'},
		  success:function(data){
			   layer.close(loading);
			   if(data.code==200){
				   var listdata = '';
				  for(var i in data.data.list){
					 var res = data.data.list[i];
					
				      if(res.keyword !='' || res.domains !='' || res.regions!='')
					      listdata += '<li data-keyword="'+res.keyword+'" data-domains="'+res.domains+'" data-regions="'+res.regions+'"><h3><a href="javascript:;" target="_blank">'+res.keyword+'&nbsp;&nbsp;</a></h3><p>领域:'+res.domains+' &nbsp;&nbsp;地区：'+res.regions+'</p></li>';
				 }
				
				 if(listdata !=''){
				    $("#searchResult").empty().append(listdata);
				 }else{
					$('#searchResultParent').remove();
					$("#agentResult").width('100%');
				 }
			   }else{
					$('#searchResultParent').remove();
					$("#agentResult").width('100%');
				 }
		  },dataType:'json'});
	
}
 getSearch();
$(function(){
	$(document).on("click",'#searchResult li',function(){
		var keyword = $(this).data('keyword');
		var regions = $(this).data('regions');
		var domains = $(this).data('domains');
		var urls = ('ziyuan.html?keyWord='+escape(keyword)+"&domains="+escape(domains)+"&areas="+escape(regions));
		
		window.location.href = urls;
   });
})

</script>